import request from '@/utils/request'

// 配置列表
export const exportConfigList = params =>
  request({
    baseURL: window.APP_GETEWAY.dexh,
    url: '/export_config/index',
    method: 'get',
    params,
  })

// 配置详情
export const exportConfigDetail = params =>
  request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_config/${params.id}`,
    method: 'get',
  })

// 新增配置
export const createExportConfig = data => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: '/export_config',
    method: 'post',
    data,
  })
}

// 修改配置
export const updateExportConfig = data => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_config/${data.id}`,
    method: 'PUT',
    data,
  })
}

// 删除配置
export const deleteExportConfig = data => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_config/${data.id}`,
    method: 'DELETE',
    data,
  })
}


// 字段模板
export const exportConfigTemplate = params => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_config/template`,
    method: 'get',
    params,
  })
}

// 新增标签
export const addExportTag = data => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_tag`,
    method: 'POST',
    data,
  })
}

// 标签列表
export const getExportTag = params => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_tag/index`,
    method: 'get',
    params,
  })
}

// 修改标签
export const putExportTag = (id,data) => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_tag/${id}`,
    method: 'PUT',
    data
  })
}

// 标签详情
export const getExportTagDetail = id => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_tag/${id}`,
    method: 'get',
  })
}

// 删除标签
export const deleteExportTag = id => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_tag/${id}`,
    method: 'DELETE',
  })
}

// 标签下拉
export const getDropDown = params => {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_tag/drop_down`,
    method: 'GET',
    params
  })
}

